package com.kotasoft.training.roogwteclipselink.shared.domain;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity
public class Asignatura {

    @NotNull
    private String nombre;

    @NotNull
    @DecimalMax("1")
    @Digits(integer = 2, fraction = 1)
    private Double creditos;

    @NotNull
    private String periodoDocencia;

    @NotNull
    @ManyToOne
    private Departamento departamento;

    @NotNull
    @OneToMany
    private Set<Profesor> profesores = new HashSet<Profesor>();
}
